package com.lyy.component;

import com.lyy.mapper.StudentMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author Liangyaoyun
 */
@Slf4j
@Component
public class ScheduledTask {
    @Autowired
    public StudentMapper studentMapper;
    @Scheduled(cron = "0 27 18 * * ?")
    public void deleteInvalidStudent(){
        studentMapper.deleteInvalidStudent();
        log.info("全部失效的学生记录清除完毕");
    }
}
